from django.db import models
from op_drf.base import BaseModel

# Create your models here.
class Depart_type(BaseModel):
    name = models.CharField(max_length=100,verbose_name="科室类型",help_text="科室类型",null=True)
    sort = models.IntegerField()

    class Meta:
        db_table = "xyx_depart_type"
        verbose_name = "科室类型"
        verbose_name_plural = verbose_name

class Department(BaseModel):
    name = models.CharField(max_length=100,null=False,verbose_name="科室",help_text="科室",default="")
    url = models.CharField(max_length=100,null=False,verbose_name="科室",help_text="科室",default="")
    img = models.CharField(max_length=100,null=False,verbose_name="图片",help_text="图片",default="")
    depart_type = models.ForeignKey(Depart_type,on_delete=models.CASCADE,verbose_name="科室类型",help_text="科室类型")

    class Meta:
        db_table = "xyx_department"
        verbose_name = "科室"
        verbose_name_plural = verbose_name